
public class SelectionSort {

	 public static int[] SelectionMethod(String selection){
		 String delimeter =" ";
			String[] parts = selection.split(delimeter);
			int[] array =  new int[parts.length];
			for(int i=0; i<parts.length; i++){
				array[i] = Integer.parseInt(parts[i]);
			}
	        int length = array.length;
	       for(int i = 0; i<length ; i++){
	            int index=i;
	            for (int j=i+1 ; j<length;j++)
	            if(array[index]>array[j])
	            index = j;
	          int smallernumber = array[index];
	            array[index]=array[i];
	            array[i] = smallernumber;
	            
	            
	        }
	        
			return array;
	     }
}
